/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * All Rights Researved.
 *
 * This library is developed and distributed for free usage,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * You can redistribute and/or modify it under the terms of the
 * Simplified BSD License
 *
 *
 *
 *
 *
 *
 *
 *
 * @Original Author: jin Chen
 * @date: Apr 17, 2004$
 * @version: 1.0
 */
package edu.psu.geovista.app.dataloader.v1.actions;

import edu.psu.geovista.app.dataloader.v1.config.model.Project;
import edu.psu.geovista.app.dataloader.v1.gui.ChooseDataPane;

import java.awt.event.ActionEvent;

public class BtnAction_ProjectTypeOk20 extends BasicAction{

    public void actionPerformed(ActionEvent e) {
        int projectType = this.dataloader.getAskProjPane().getProjectType();
        //wizard.setProjectCategory(projectType);
        if(projectType== WizardData.Current){// 
            //get info
            wizardData.setProjectCategory(projectType);
            String pn=dataloader.getCurrentProjectName();
            Project project = dataloader.getProjBd().getProject(pn); // 0416 getConfiguror().getProjectByID(pn);
            wizardData.setProject(project);

            //setup next page
            ChooseDataPane p = dataloader.getChooseDataPane();
            p.setPcpDataLoad(project.getPcpdata().isLoad() );
            p.setTsDataLoad(project.getTsdata().isLoad() );
            //dataloader.setDataInfo(wizard.getProjectClone());
            dataloader.showChooseDataDlg() ;//for current project, skip project pane
        }
        else{
            //for new project or other projects, clean runtime project in wizard
            wizardData.clean() ;
            wizardData.setProjectCategory(projectType);
            dataloader.showProjectDlg();
        }

    }
}